package org.test.proxy.cglib;

import java.lang.reflect.Method;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

/**
 * 定义一个拦截器,代理处理器
 * @author wb-chenkang
 *
 */
public class MyMethodInterceptor  implements MethodInterceptor {

	@Override
	public Object intercept(Object object, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
		System.out.println(">>>MethodInterceptor start..."); 
        Object result = methodProxy.invokeSuper(object,args); 
        System.out.println(">>>MethodInterceptor ending..."); 
		return result;
	}
	
}
